/**
 * 
 */
package feeinterface.dao;

import com.ulwx.database.DataBase.MainSlaveModeConnectMode;
import com.ulwx.tool.DbUtils;

import feeinterface.modeldb.SysRole;

/**
 * 接口或类的说明: 该dao主要给测试用，通过调用该dao测试是否连接数据库正常，并不涉及业务
 *
 *
 * @开发：linrb
 * @版本：1.0
 * @创建时间：2012-3-2
 */
public class TestDao {
	public static boolean testConnectMainDB(){
		String sql = "SELECT * FROM SysRole";
		try {
			DbUtils.doQueryClass(null, SysRole.class, sql, null, 
					MainSlaveModeConnectMode.Connect_MainServer);
		} catch (Exception e) {
			return false;
		}
		return true;
	}
	
	public static boolean testConnectSlaveDB(){
		String sql = "SELECT * FROM SysRole";
		try {
			DbUtils.doQueryClass(null, SysRole.class, sql, null, 
					MainSlaveModeConnectMode.Connect_SlaveServer);
		} catch (Exception e) {
			return false;
		}
		return true;
	}
}
